<!DOCTYPE html>
<html lang="zh-CN" class="loading">

<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>STM32学习笔记(1)中断 - Skyone-Blog</title>
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <meta name="google" content="notranslate" />
    <meta name="keywords" content="STM32,MCU,单片机,"> 
    <meta name="description" content="Skyone技术博客,记录STM32学习历程，本文介绍了如何配置、使用GPIO中断"> 
    <meta name="author" content="王志伟"> 
    <link rel="alternative" href="atom.xml" title="Skyone-Blog" type="application/atom+xml"> 
    <link rel="icon" href="/img/favicon.png"> 
    
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.css">

    
<link rel="stylesheet" href="/css/diaspora.css">

    <!-- 看板娘
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome/css/font-awesome.min.css">
    <script src="/live2d-widget/autoload.js"></script>
    -->
    <!-- MD5 -->
    <script src="/js/md5.min.js"></script>
    <!-- MathJax -->
    
        <script type="text/x-mathjax-config">
        (function () {
            let target = document.getElementsByClassName("content")[0];
            MathJax.Hub.Config({
                tex2jax: {
                    inlineMath:  [ ["$", "$"] ],
                    displayMath: [ ["$$","$$"] ],
                    skipTags: ['script', 'noscript', 'style', 'textarea', 'pre','code','a'],
                    ignoreClass:"class1"
                }
            });
            MathJax.Hub.Queue(["Typeset",MathJax.Hub,target]);
        })();
    </script>
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>

    
<meta name="generator" content="Hexo 5.3.0"></head>

<body class="loading">
    <span id="config-title" style="display:none">Skyone-Blog</span>
    <div id="loader"></div>
    <div id="single">
    <div id="top" style="display: block;">
    <div class="bar" style="width: 0;"></div>
    <a class="iconfont icon-home image-icon" href="javascript:;" data-url="https://www.skyone.host"></a>
    <div title="播放/暂停" class="iconfont icon-play"></div>
    <h3 class="subtitle">STM32学习笔记(1)中断</h3>
    <div class="social">
        <div>
            <div class="share">
                <a title="获取二维码" class="iconfont icon-scan" href="javascript:;"></a>
            </div>
            <div id="qr"></div>
        </div>
    </div>
    <div class="scrollbar"></div>
</div>

    <div class="section">
        <div class="article">
    <div class='main'>
        <h1 class="title">STM32学习笔记(1)中断</h1>
        <div class="stuff">
            <span>六月 25, 2021</span>
            
  <ul class="post-tags-list" itemprop="keywords"><li class="post-tags-list-item"><a class="post-tags-list-link" href="/tags/STM32/" rel="tag">STM32</a></li></ul>


        </div>
        <div class="content markdown">
            <p><strong>本文章适用于STM32F103RBT6</strong>，其他型号可能有所不同</p>
<p>开发模板见我的GitHub仓库<a target="_blank" rel="noopener" href="https://github.com/skyone-wzw/STM32F103RBT6-template.git">skyone-wzw@STM32F103RBT6-template</a></p>
<p>如果你觉得这篇文章有帮助，请star仓库或评论回复吧~</p>
<p>如果文章有任何错误（包括错别字）可以在<a target="_blank" rel="noopener" href="https://github.com/skyone-wzw/blog/issues">这里</a>提交Issue或<a href="mailto:wzw@skyone.host">邮件</a>联系我</p>
<h2 id="设置NVIC中断分组"><a href="#设置NVIC中断分组" class="headerlink" title="设置NVIC中断分组"></a>设置NVIC中断分组</h2><h3 id="用到的函数"><a href="#用到的函数" class="headerlink" title="用到的函数"></a>用到的函数</h3><p><code>NVIC_PriorityGroupConfig()</code></p>
<p>设置中断分组</p>
<p>可选：</p>
<ul>
<li><p><code>NVIC_PriorityGroup_0</code></p>
<p>抢占优先级0位，响应优先级4位</p>
</li>
<li><p><code>NVIC_PriorityGroup_1</code></p>
<p>抢占优先级1位，响应优先级3位</p>
</li>
<li><p><code>NVIC_PriorityGroup_2</code></p>
<p>抢占优先级2位，响应优先级2位</p>
</li>
<li><p><code>NVIC_PriorityGroup_3</code></p>
<p>抢占优先级3位，响应优先级1位</p>
</li>
<li><p><code>NVIC_PriorityGroup_4</code></p>
<p>抢占优先级4位，响应优先级0位</p>
</li>
</ul>
<h3 id="抢占优先级与响应优先级"><a href="#抢占优先级与响应优先级" class="headerlink" title="抢占优先级与响应优先级"></a>抢占优先级与响应优先级</h3><p>这两个优先级都是<strong>数值越小，优先级越高</strong></p>
<ul>
<li>当A中断抢占优先级高于B中断，不论响应优先级如何，如果中断同时发生，A中断先执行，B中断后执行；如果B中断正在执行，A中断发生，A中断<strong>可以</strong>打断B中断的执行，先执行A中断，再继续执行B中断。</li>
<li>当A中断抢占优先级与B中断相等，如果A中断响应优先级高于B中断，如果中断同时发生，A中断先执行，B中断后执行；如果B中断正在执行，A中断发生，A中断<strong>不可以</strong>打断B中断的执行！</li>
</ul>
<h2 id="中断线和中断初始化"><a href="#中断线和中断初始化" class="headerlink" title="中断线和中断初始化"></a>中断线和中断初始化</h2><h3 id="相关函数"><a href="#相关函数" class="headerlink" title="相关函数"></a>相关函数</h3><p><code>GPIO_EXTILineConfig(GPIO_PortSource, GPIO_PinSource)</code></p>
<p>IO口与中断线连接</p>
<p>例如：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">GPIO_EXTILineConfig(GPIO_PortSourceGPIOA, GPIO_PinSource1);</span><br><span class="line"><span class="comment">// GPIOA_1 与中断线1连接</span></span><br></pre></td></tr></table></figure>
<hr>
<p> <code>EXTI_Init(&amp;EXTI_InitTypeDef)</code></p>
<p>定义中断类型，即当什么时候触发中断</p>
<p>对于结构体<code>EXTI_InitTypeDef</code></p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">typedef</span> <span class="class"><span class="keyword">struct</span> &#123;</span></span><br><span class="line">    <span class="comment">// 中断线：0~15</span></span><br><span class="line">	<span class="keyword">uint32_t</span> EXTI_Line;</span><br><span class="line">    <span class="comment">/* 选择模式：</span></span><br><span class="line"><span class="comment">    	* 产生中断(EXTI_Mode_Interrupt)</span></span><br><span class="line"><span class="comment">    	* 产生事件(EXTI_Mode_Event)</span></span><br><span class="line"><span class="comment">    */</span></span><br><span class="line">	EXTIMode_TypeDef EXTI_Mode;</span><br><span class="line">    <span class="comment">/* 选择触发方式:</span></span><br><span class="line"><span class="comment">    	下降沿触发(EXTI_Trigger_Falling)</span></span><br><span class="line"><span class="comment">    	上升沿触发(EXTI_Trigger_Rising)</span></span><br><span class="line"><span class="comment">    	上升沿和下降沿都触发(EXTI_Trigger_Rising_Falling)</span></span><br><span class="line"><span class="comment">    */</span></span><br><span class="line">	EXTITrigger_TypeDef EXTI_Trigger;</span><br><span class="line">    <span class="comment">// 使能中断线</span></span><br><span class="line">	FunctionalState EXTI_LineCmd;</span><br><span class="line">&#125; EXTI_InitTypeDef;</span><br></pre></td></tr></table></figure>
<p>例如：</p>
 <figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">EXTI_InitTypeDef exti;</span><br><span class="line"><span class="comment">// 选择要设置的中断线</span></span><br><span class="line">exti.EXTI_Line = EXTI_Line3;</span><br><span class="line"><span class="comment">// 选择模式：产生中断</span></span><br><span class="line">exti.EXTI_Mode = EXTI_Mode_Interrupt;</span><br><span class="line"><span class="comment">// 选择触发方式为下降沿触发</span></span><br><span class="line">exti.EXTI_Trigger = EXTI_Trigger_Falling;</span><br><span class="line"><span class="comment">// 使能</span></span><br><span class="line"><span class="built_in">exit</span>.EXTI_LineCmd = ENABLE;</span><br><span class="line">EXTI_Init(&amp;exti);</span><br></pre></td></tr></table></figure>
<h3 id="中断线"><a href="#中断线" class="headerlink" title="中断线"></a>中断线</h3><p>中断线有16个：0~15</p>
<p>每组<code>GPIOx</code>都有16个IO，<code>GPIOA_0</code>、<code>GPIOB_0</code>等分别对应中断线0，以此类推。</p>
<h2 id="设置中断优先级"><a href="#设置中断优先级" class="headerlink" title="设置中断优先级"></a>设置中断优先级</h2><h3 id="相关函数-1"><a href="#相关函数-1" class="headerlink" title="相关函数"></a>相关函数</h3><p><code>NVIC_Init(&amp;NVIC_InitTypeDef)</code></p>
<p>设置中断优先级</p>
<p>对应结构体<code>NVIC_InitTypeDef</code></p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">typedef</span> <span class="class"><span class="keyword">struct</span> &#123;</span></span><br><span class="line">    <span class="comment">// 设置中断通道</span></span><br><span class="line">	<span class="keyword">uint8_t</span> NVIC_IRQChannel;</span><br><span class="line">    <span class="comment">// 设置抢占优先级</span></span><br><span class="line">	<span class="keyword">uint8_t</span> NVIC_IRQChannelPreemptionPriority;</span><br><span class="line">    <span class="comment">// 设置响应优先级</span></span><br><span class="line">	<span class="keyword">uint8_t</span> NVIC_IRQChannelSubPriority;</span><br><span class="line">    <span class="comment">// 使能</span></span><br><span class="line">	FunctionalState NVIC_IRQChannelCmd;</span><br><span class="line">&#125; NVIC_InitTypeDef;</span><br></pre></td></tr></table></figure>
<p>例如：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">NVIC_InitTypeDef nvic;</span><br><span class="line"><span class="comment">// 设置中断通道为：第0通道</span></span><br><span class="line">nvic.NVIC_IRQChannel = EXTI0_IRQn;</span><br><span class="line"><span class="comment">// 设置抢占优先级为：2</span></span><br><span class="line">nvic.NVIC_IRQChannelPreemptionPriority = <span class="number">0x02</span>;</span><br><span class="line"><span class="comment">// 设置响应优先级为：3</span></span><br><span class="line">nvic.NVIC_IRQChannelSubPriority = <span class="number">0x03</span>;</span><br><span class="line"><span class="comment">// 使能</span></span><br><span class="line">nvic.NVIC_IRQChannelCmd = ENABLE;</span><br><span class="line">NVIC_Init(&amp;nvic); </span><br></pre></td></tr></table></figure>
<h3 id="中断通道"><a href="#中断通道" class="headerlink" title="中断通道"></a>中断通道</h3><p>中断通道一共7个：</p>
<ul>
<li><code>EXTI0_IRQn</code></li>
<li><code>EXTI1_IRQn</code></li>
<li><code>EXTI2_IRQn</code></li>
<li><code>EXTI3_IRQn</code></li>
<li><code>EXTI4_IRQn</code></li>
<li><code>EXTI9_5_IRQn</code></li>
<li><code>EXTI15_10_IRQn</code></li>
</ul>
<h2 id="中断处理函数"><a href="#中断处理函数" class="headerlink" title="中断处理函数"></a>中断处理函数</h2><p>中断处理函数与中断通道一一对应一共7个</p>
<ul>
<li><code>void EXTI0_IRQHandler()</code></li>
<li><code>void EXTI1_IRQHandler()</code></li>
<li><code>void EXTI2_IRQHandler()</code></li>
<li><code>void EXTI3_IRQHandler()</code></li>
<li><code>void EXTI4_IRQHandler()</code></li>
<li><code>void EXTI9_5_IRQHandler()</code></li>
<li><code>void EXTI15_10_IRQHandler()</code></li>
</ul>
<p>常用API：</p>
<ul>
<li><p><code>ITStatus EXTI_GetITStatus(EXTI_Line)</code></p>
<p>判断指定中断线上，是否发生中断，常用于<code>EXTI9_5</code>与<code>EXTI15_10</code>上判断具体是哪一个中断线上来的中断</p>
</li>
<li><p><code>void EXTI_ClearITPendingBit(EXTI_Line)</code></p>
<p>消除指定中断线上的中断标志，<strong>中断处理操作完成后必须调用！</strong></p>
</li>
</ul>
<h2 id="中断、中断线、中断通道、中断处理函数的关系"><a href="#中断、中断线、中断通道、中断处理函数的关系" class="headerlink" title="中断、中断线、中断通道、中断处理函数的关系"></a>中断、中断线、中断通道、中断处理函数的关系</h2><p>以西瓜汁生产线类比：</p>
<p>GPIO引脚触发中断相当于果园生产西瓜</p>
<p>中断线相当于西瓜运输线</p>
<p>中断通道相当于运输线上的桥，例如运输线1(中断线1)必须经过桥1(中断通道1)，运输线5-9(中断线5到中断线9)必须经过桥9_5(<code>EXTI9_5_IRQn</code>)</p>
<p>中断处理函数相当于西瓜汁生产厂，处理运来的西瓜</p>
<h2 id="所有流程"><a href="#所有流程" class="headerlink" title="所有流程"></a>所有流程</h2><p>该流程不包括GPIO的配置</p>
<ol>
<li><p>设置中断分组</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);</span><br></pre></td></tr></table></figure></li>
<li><p>初始化中断线</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">// 连接中断线3</span></span><br><span class="line">GPIO_EXTILineConfig(GPIO_PortSourceGPIOC,GPIO_PinSource3);</span><br><span class="line"></span><br><span class="line">EXTI_InitTypeDef exti;</span><br><span class="line"><span class="comment">// 中断线3、产生中断、下降沿触发 使能</span></span><br><span class="line">exti.EXTI_Line = EXTI_Line3;</span><br><span class="line">exti.EXTI_Mode = EXTI_Mode_Interrupt;	</span><br><span class="line">exti.EXTI_Trigger = EXTI_Trigger_Falling;</span><br><span class="line">exti.EXTI_LineCmd = EANBLE;</span><br><span class="line">EXTI_Init(&amp;exti);</span><br></pre></td></tr></table></figure></li>
<li><p>设置中断优先级</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">NVIC_InitTypeDef nvic;</span><br><span class="line"><span class="comment">// 中断通道3(对应中断线3) 抢占优先级2 响应优先级3 使能</span></span><br><span class="line">NVIC_InitStructure.NVIC_IRQChannel = EXTI3_IRQn;</span><br><span class="line">NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = <span class="number">0x02</span>;</span><br><span class="line">NVIC_InitStructure.NVIC_IRQChannelSubPriority = <span class="number">0x03</span>;</span><br><span class="line">NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;</span><br><span class="line">NVIC_Init(&amp;NVIC_InitStructure); </span><br></pre></td></tr></table></figure></li>
<li><p>定义中断处理函数</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">EXTI0_IRQHandler</span><span class="params">(<span class="keyword">void</span>)</span> </span>&#123;</span><br><span class="line">	delay_ms(<span class="number">10</span>); <span class="comment">// 消抖</span></span><br><span class="line">	<span class="keyword">if</span> (GPIO_ReadInputDataBit(GPIOC, GPIO_Pin_3)) &#123;</span><br><span class="line">		<span class="keyword">if</span> (GPIO_ReadOutputDataBit(GPIOA, GPIO_Pin_1)) &#123;</span><br><span class="line">            GPIO_ResetBits(GPIOA, GPIO_Pin_1);</span><br><span class="line">        &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">            GPIO_SetBits(GPIOA, GPIO_Pin_1);</span><br><span class="line">        &#125;</span><br><span class="line">	&#125;</span><br><span class="line">	EXTI_ClearITPendingBit(EXTI_Line3);</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></li>
</ol>

            <!--[if lt IE 9]><script>document.createElement('audio');</script><![endif]-->
            <audio id="audio" loop="1" preload="auto" controls="controls" data-autoplay="false">
                <source type="audio/mpeg" src="">
            </audio>
            
                <ul id="audio-list" style="display:none">
                    
                        
                            <li title='0' data-url='https://tc.skyone.host/blog/music/%E6%B4%9B%E5%A4%A9%E4%BE%9D%20-%20%E5%A4%9C%E8%88%AA%E6%98%9F.flac'></li>
                        
                    
                        
                            <li title='1' data-url='https://tc.skyone.host/blog/music/%E6%B4%9B%E5%A4%A9%E4%BE%9D%20-%20%E8%8C%89%E8%8E%89%E8%8A%B1.mp3'></li>
                        
                    
                        
                            <li title='2' data-url='https://tc.skyone.host/blog/music/%E8%B5%A4%E7%BE%BD%20-%20%E4%B8%87%E5%8F%A4%E7%94%9F%E9%A6%99.flac'></li>
                        
                    
                        
                            <li title='3' data-url='https://tc.skyone.host/blog/music/%E6%B4%9B%E5%A4%A9%E4%BE%9D%20-%20%E4%B8%BA%E8%B0%81%E8%80%8C%E4%B8%BA.mp3'></li>
                        
                    
                        
                            <li title='4' data-url='https://tc.skyone.host/blog/music/%E4%B9%90%E6%AD%A3%E7%BB%AB%20-%20Faded.mp3'></li>
                        
                    
                        
                            <li title='5' data-url='https://tc.skyone.host/blog/music/bilibili2018%20-%20%E8%87%B3%E5%B0%8A%E9%A9%AC%E7%94%B2.flac'></li>
                        
                    
                </ul>
            
        </div>
        
    <div id='gitalk-container' class="comment link"
		data-enable='true'
        data-ae='true'
        data-ci='d5e197ef955b7f3268e5'
        data-cs='7d4feed7a179ad28943b0865b7970814073145ad'
        data-r='blog-gitalk'
        data-o='skyone-wzw'
        data-a='skyone-wzw'
        data-d='false'
    >查看评论</div>


    </div>
    
        <div class='side'>
			<ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E8%AE%BE%E7%BD%AENVIC%E4%B8%AD%E6%96%AD%E5%88%86%E7%BB%84"><span class="toc-number">1.</span> <span class="toc-text">设置NVIC中断分组</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E7%94%A8%E5%88%B0%E7%9A%84%E5%87%BD%E6%95%B0"><span class="toc-number">1.1.</span> <span class="toc-text">用到的函数</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%8A%A2%E5%8D%A0%E4%BC%98%E5%85%88%E7%BA%A7%E4%B8%8E%E5%93%8D%E5%BA%94%E4%BC%98%E5%85%88%E7%BA%A7"><span class="toc-number">1.2.</span> <span class="toc-text">抢占优先级与响应优先级</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%B8%AD%E6%96%AD%E7%BA%BF%E5%92%8C%E4%B8%AD%E6%96%AD%E5%88%9D%E5%A7%8B%E5%8C%96"><span class="toc-number">2.</span> <span class="toc-text">中断线和中断初始化</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E7%9B%B8%E5%85%B3%E5%87%BD%E6%95%B0"><span class="toc-number">2.1.</span> <span class="toc-text">相关函数</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%B8%AD%E6%96%AD%E7%BA%BF"><span class="toc-number">2.2.</span> <span class="toc-text">中断线</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E8%AE%BE%E7%BD%AE%E4%B8%AD%E6%96%AD%E4%BC%98%E5%85%88%E7%BA%A7"><span class="toc-number">3.</span> <span class="toc-text">设置中断优先级</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E7%9B%B8%E5%85%B3%E5%87%BD%E6%95%B0-1"><span class="toc-number">3.1.</span> <span class="toc-text">相关函数</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%B8%AD%E6%96%AD%E9%80%9A%E9%81%93"><span class="toc-number">3.2.</span> <span class="toc-text">中断通道</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%B8%AD%E6%96%AD%E5%A4%84%E7%90%86%E5%87%BD%E6%95%B0"><span class="toc-number">4.</span> <span class="toc-text">中断处理函数</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%B8%AD%E6%96%AD%E3%80%81%E4%B8%AD%E6%96%AD%E7%BA%BF%E3%80%81%E4%B8%AD%E6%96%AD%E9%80%9A%E9%81%93%E3%80%81%E4%B8%AD%E6%96%AD%E5%A4%84%E7%90%86%E5%87%BD%E6%95%B0%E7%9A%84%E5%85%B3%E7%B3%BB"><span class="toc-number">5.</span> <span class="toc-text">中断、中断线、中断通道、中断处理函数的关系</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%89%80%E6%9C%89%E6%B5%81%E7%A8%8B"><span class="toc-number">6.</span> <span class="toc-text">所有流程</span></a></li></ol>	
        </div>
    
</div>


    </div>
</div>
</body>

<script src="//cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js"></script>


<script src="//lib.baomitu.com/jquery/1.8.3/jquery.min.js"></script>
<script src="/js/plugin.js"></script>
<script src="/js/typed.js"></script>
<script src="/js/skyone.min.js"></script>


<link rel="stylesheet" href="/photoswipe/photoswipe.css">
<link rel="stylesheet" href="/photoswipe/default-skin/default-skin.css">


<script src="/photoswipe/photoswipe.min.js"></script>
<script src="/photoswipe/photoswipe-ui-default.min.js"></script>


<!-- Root element of PhotoSwipe. Must have class pswp. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
    <!-- Background of PhotoSwipe. 
         It's a separate element as animating opacity is faster than rgba(). -->
    <div class="pswp__bg"></div>
    <!-- Slides wrapper with overflow:hidden. -->
    <div class="pswp__scroll-wrap">
        <!-- Container that holds slides. 
            PhotoSwipe keeps only 3 of them in the DOM to save memory.
            Don't modify these 3 pswp__item elements, data is added later on. -->
        <div class="pswp__container">
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
        </div>
        <!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
        <div class="pswp__ui pswp__ui--hidden">
            <div class="pswp__top-bar">
                <!--  Controls are self-explanatory. Order can be changed. -->
                <div class="pswp__counter"></div>
                <button class="pswp__button pswp__button--close" title="Close (Esc)"></button>
                <button class="pswp__button pswp__button--share" title="Share"></button>
                <button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>
                <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>
                <!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR -->
                <!-- element will get class pswp__preloader--active when preloader is running -->
                <div class="pswp__preloader">
                    <div class="pswp__preloader__icn">
                      <div class="pswp__preloader__cut">
                        <div class="pswp__preloader__donut"></div>
                      </div>
                    </div>
                </div>
            </div>
            <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
                <div class="pswp__share-tooltip"></div> 
            </div>
            <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
            </button>
            <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
            </button>
            <div class="pswp__caption">
                <div class="pswp__caption__center"></div>
            </div>
        </div>
    </div>
</div>




</html>
